package com.hsgene.authority.service;

import com.hsgene.authority.domain.GeneticTestingOperationPermission;
import com.hsgene.authority.dto.OperationPermissionTree;
import com.hsgene.common.util.result.ApiResult;
import com.hsgene.common.util.result.NullObject;

import java.util.List;

/**
 * 权限服务Service
 *
 * @author wangbing
 * @version 1.0, 2018/11/5
 */
public interface PermissionService {

    /**
     * 添加权限
     *
     * @param permission 权限信息
     * @return 添加结果
     */
    ApiResult<NullObject> addPermission(GeneticTestingOperationPermission permission);

    /**
     * 获取完整权限树
     *
     * @return 完整权限树
     */
    OperationPermissionTree getWholePermissionTrees();

    /**
     * 获取权限树
     *
     * @param permissionId 权限id
     * @param wholeTree    是否返回完整子树
     * @return 权限树
     */
    OperationPermissionTree getPermissionTree(String permissionId, boolean wholeTree);

    /**
     * 更新权限信息
     *
     * @param permission 权限信息
     * @return 更新结果
     */
    ApiResult<NullObject> updatePermission(GeneticTestingOperationPermission permission);

    /**
     * 删除权限信息
     *
     * @param permissionId 权限id
     * @return 删除结果
     */
    ApiResult<NullObject> deletePermission(String permissionId);

}
